package com.xiashitech.agent.instrumentation.base.context;

import javax.annotation.Nullable;

public interface XSContextStorage {

    static XSContextStorage get() {
        return defaultStorage();
    }

    static XSContextStorage defaultStorage() {
        return ReentryContextStorage.INSTANCE;
    }

    void attach(XSContext toAttach);

    @Nullable
    XSContext current();

    default XSContext root() {
        return ReentryArrayBasedContext.root();
    }

    void close();
}
